const ArData = require('./getSingersData');
let singerDataArr = ArData.request();


  console.log(singerDataArr);



function fn(){
  let musicDatas = [];
 //获取每一个的歌手的歌曲url
singerDataArr.forEach(function(index, item){
 let singerData = JSON.parse(index);
 ///针对每一个歌手的热门歌曲
singerData.hotSongs.forEach(function(index, item){
let json = {
  'name':index.name,
  'id':index.id,
  'url':`http://music.163.com/song/media/outer/url?id=${index.id}.mp3`,
  'number':item+1,
  'musician': index.ar[0].name,
  'alImg':index.al.picUrl,
  'dt':index.dt,
}
musicDatas.push(json);
})
})
return musicDatas;
}

//返回的是一个数组，内有歌曲的url，name，jpg
module.exports = fn;